﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace iMall.AtoZ.Helper
{
    public class EntityBase
    {
        public EntityBase ( ) { }

        public EntityBase ( DataRow dr )
        {
            foreach ( DataColumn dc in dr.Table.Columns )
            {
                SetValue(dc.ColumnName, dr[dc.ColumnName].ToString());
            }
        }

        public void SetValue ( string field, string value )
        {
            if ( field == null || field.Length < 1 )
            { return; }

            AtoZUtility.SetObjPropertyValue(this, field, value);
        }
    }
}